package java4;

import java.util.Scanner;

public class T42 {

		public static void main(String[] args) {
		    Scanner sc = new Scanner(System.in);
		    int n=sc.nextInt();
		    Computer[] computer=new Computer[n];
		    for (int i = 0; i < n; i++) {
				String str=sc.next();
				if(str=="c"){
					computer[i]=new Computer();
					break;
				}
				if(str=="d"){
					computer[i]=new Computer(sc.nextDouble());
				}
				if(str=="i"){
					computer[i]=new Computer(sc.nextBigInteger());
					break;
				}
				if(str=="s"){
					computer[i]=new Computer(sc.next());
					break;
				}
				else{
					computer[i]=new Computer("");
				}
			}
		    for (int i = n-1; i >=0; i--) {
				System.out.println(computer[i].toString());
			}
		    sc.close();
		}

	}

